<template>
  <div class="alertBox">
      
      <div class="info" v-if="txt.type==1">
        <p class="titleA">{{txt.message}}</p>
        <p class="click"><span @click="close">关闭</span></p>
      </div>

      <div class="info" v-if="txt.type==2">
        <p class="titleB">{{txt.message}}</p>
      </div>

      <div class="info" v-if="txt.type==3">
        <p class="titleC">{{txt.message}}</p>
        <p class="click"><span @click="goBack">确定</span></p>
      </div>
  </div>
</template>
<script>
export default {
  name: 'alert',
  props:['txt'],
  methods:{
    close(){
      this.$store.dispatch("alert",false)
    },
    goBack(){
      this.$store.dispatch("alert",false)
      this.$router.go(-1)
    }
  }
}

</script>
